Release 10.1A: OpenEdge Development:
Progress 4GL Reference
BUFFER-COPY statement
Performs a bulk copy of a source record to a target record by copying each source field to the target field of the same name. You can specify a list of fields to exclude from the bulk copy, or a list of fields to include in the bulk copy. You can also specify WHEN...THEN phrases. For each such phrase, BUFFER-COPY executes the THEN portion if the corresponding WHEN portion evaluates to TRUE.
Syntax
sourceThe source database table, buffer, temporary table, or work table.
EXCEPTfield...A list of space-separated source fields to exclude from the bulk copy.
USINGfield...A list of space-separated source fields to include in the bulk copy. The USING option is simply a positive version of the EXCEPT option.
TOtargetThe source database table, buffer, temporary table, or work table.
ASSIGNassign-expressionA space-separated list of any valid Progress 4GL ASSIGN statements (without the EXCEPT option, which BUFFER-COPY already provides). BUFFER-COPY performs each
assign-expressionand automatically excludes the field on the left side (“destination”) of eachassign-expressionfrom the bulk copy-except for field extents (subscripted fields). If a field extent appears on the left side of an assign-expression, BUFFER-COPY does not automatically exclude that extent (such as customer.mnth-sales[1]) or the field as a whole (such as customer.mnth-sales) from the bulk copy.NO-LOBSDirects Progress to ignore large object data when copying records that contain BLOB or CLOB fields.
NO-ERRORDiverts any error messages from this statement to the ERROR-STATUS system handle and records the success of this statement in ERROR-STATUS:ERROR.
Notes
- At compile time, BUFFER-COPY:
- Fails to compile if any source-target field pair is not type compatible.
- Excludes from the bulk copy all EXCEPT
fieldfields, and allassign-expressionfields on the left side of the assignment.- Automatically excludes fields that appear in the source but not the target from the bulk copy.
- Tries to bind unqualified field names that appear in the EXCEPT and USING options to the source buffer.
- At run time, BUFFER-COPY:
- The BUFFER-COPY statement, like the VALIDATE statement, must appear within the scope of a FIND, a FOR EACH, or a CREATE statement that references the source table.
- If a BUFFER-COPY statement references a target buffer for the first time, Progress regards this reference as a “free reference” and scopes the buffer to the nearest enclosing block that can scope records. For more information on free references, see the chapter on block properties in OpenEdge Development: Progress 4GL Handbook .
- With respect to transaction processing, Progress treats a BUFFER-COPY statement the same way it would treat equivalent ASSIGN statements. For more information on transaction processing, see the chapter on transactions in OpenEdge Development: Progress 4GL Handbook .
- The compiler’s XREF facility automatically creates a REFERENCE for each field in the fields list, a TABLE-REFERENCE for the source and target buffers, ACCESS and UPDATE references for any fields in the ASSIGN option, and ACCESS (or UPDATE) references for each source (or target) field that participates in the bulk copy.
- When copying records that contain a BLOB or CLOB field, Progress copies the object data associated with the source record to the target record. If the BLOB or CLOB field in the source record contains the Unknown value (
?), Progress stores the Unknown value (?) in the BLOB or CLOB field of the target record. If the target record already has object data associated with it, Progress deletes that object data before copying the new object data.- Use the
NO-LOBSoption with the BUFFER-COPY statement to ignore large object data when copying records that contain BLOB or CLOB fields. More specifically:
- When you copy a source record to a new target record, Progress sets the value of the BLOB or CLOB field in the target record to the Unknown value (
?).- When you copy a source record to an existing target record, Progress does not change the value of the BLOB or CLOB field in the existing target record.
You can also use the
EXCEPToption to exclude BLOB and CLOB fields from the copy.See also
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |